/**
 * Created by zzw on 2016/8/8.
 * 理解面向对象
 */

var student = new Object();
student.age = 11;
student.name = '张三';
student.sex = '男';

student.study = function(){
     console.log('学习ing....');
};

console.log(student.age);

/**
 * 定义一个教师类
 */

var student1 = {
    name:"zhangsan",
    age:11,
    job:"IT",
    sayName:function(){
          console.log("hao123");
    }

}
//student1.sayName();
//
//var teacher2 = {};
//Object.defineProperties(teacher2,"name",{
//    writable:false,
//    value:"zhangsan"
//});
//
//console.log(teacher2.name);

//var book = {
//    _year:2014,
//    edition:1
//}
//
//Object.defineProperties(book,"year",{
//    get:function(){
//         return this._year;
//    },
//    set:function(newValue){
//          if(newValue>2014){
//              this._year=newValue;
//              this.edition+=newValue-2014;
//          }
//    }
//});

//book._year=2016;
//console.log(book.edition);



